﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using EightBeatsAPI.Controllers;
using System.IO;
using System.Reflection;
using EightBeatsAPI.UnitTests.Properties;
using System.Web.Http;
using System.Threading.Tasks;
using System.Net.Http;

namespace EightBeatsAPI.UnitTests
{
    [TestClass]
    public class AudioControllerUnitTest
    {
        [TestMethod]
        public async Task Test_Post()
        {
            AudioController controller = new AudioController();
            IHttpActionResult result = await controller.Post(Resources.AudioFileContent, "audio/mpeg");


            //Check return status code
            Assert.IsInstanceOfType(result, typeof(System.Web.Http.Results.OkNegotiatedContentResult<Guid>));
        }

        [TestMethod]
        public async Task Test_Get()
        {
            Guid ProcessId = Guid.NewGuid();

            AudioController controller = new AudioController();
            HttpResponseMessage result = await controller.Get(ProcessId);

            //Check return status code
            Assert.IsInstanceOfType(result, typeof(HttpResponseMessage));
        }
    }
}
